package com.graduation.mapper;

import com.graduation.model.PromotionEntity;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description 活动对应的数据库操作
 * @Author YaoQi
 * @Date 2018/3/19 23:50
 */
public interface PromotionMapper {

    /**
     * promotionEntity对应的数据库表
     */
    String PROMOTION_TABLE_NAME = "WEB_SHOPPING_PROMOTION";

    @Select(
            "SELECT ID ,TITLE,DESCRIPTION,STATUS,PICTURE,URL,PRODUCT_ID AS productId, SELLER_ID AS sellerId," +
                    "ORIGINAL_PRICE as originalPrice, CURRENT_PRICE AS currentPrice, PUBLISH_TIME AS publishTime," +
                    "END_TIME AS endTime, SALES_VOLUME AS salesVolume, CREATE_TIME AS createTime, CREATE_USER AS createUser," +
                    "UPDATE_TIME AS createTime" +
                    "  FROM " + PROMOTION_TABLE_NAME
    )
    List<PromotionEntity> getPromotionList();
}
